﻿<!DOCTYPE html>
<!--危险能量（物料）-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    <div id="app" v-cloak class="popupW150">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="140px"
                 size="mini">
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.HazardousEnergy" autocomplete="off" size="mini" >
                                <template slot="prepend">
                                    {{LockedCheck.HazardousEnergy+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Harm" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{LockedCheck.Harm+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item> 
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div> {{LockedCheck.IsolationMethod+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.IsolationMethod" slot="suffix" :placeholder="Form.IsolationMethod">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in IsolationMethod" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" :offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.IsolationPoint" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{LockedCheck.IsolationPoint+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div> {{LockedCheck.LockedSigner+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.LockedSigner" slot="suffix" :placeholder="Form.LockedSigner">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in LockedSigner" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                

            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm">{{col.btnSave}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    HazardousEnergy: "",
                    Harm: "",
                    IsolationMethod: "",
                    IsolationPoint: "",
                    LockedSigner: "",
                },
                IsolationMethod: [],
                LockedSigner: [],
                ListItem: ListItem,
                //表单验证
                rules: {
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                onSubmitForm: function () {

                    parent.app.Form.HazardousList.push({
                        HazardousEnergy: this.Form.HazardousEnergy,
                        Harm: this.Form.Harm,
                        IsolationPoint: this.Form.IsolationPoint,
                        IsolationMethod: getDicValue('138', this.Form.IsolationMethod),
                        LockedSigner: getDicValue('09', this.Form.LockedSigner),
                    });
                    parent.app.ListItem.dialogVisible = false;
                },
            },
            mounted: function () {
                this.IsolationMethod = getDicData('138');
                this.LockedSigner = getDicData('09');
                this.id = getUrlParam("id");
            }
        });
    </script>
</body>

</html>